#include<ros/ros.h>
#include<std_msgs/Float32.h>

int main(int argc, char** argv)
{
    ros::init(argc,argv,"q3_2b");
    ros::NodeHandle n;
    ros::Publisher num_pub=n.advertise<std_msgs::Float32>("send_2b",20);
    // 设置循环频率
    ros::Rate rate(5); // 5Hz 200ms
    while(ros::ok())
    {
        std_msgs::Float32 b;
        b.data=6.0;
        num_pub.publish(b);
        ROS_INFO("b=%f", b.data);
        ros::spinOnce();
        rate.sleep();
    }
    return 0;
}